package main

func main()  {

}

type doorNode struct {
	val int
	next *doorNode
}

func getDoorNode(head *doorNode) *doorNode {
	if head==nil || head.next == nil {
		return nil
	}
	fast,slow := head,head
	isCunzai := false
	for fast != nil && fast.next != nil{
		if fast == slow {
			isCunzai = true
			break
		}
		fast = fast.next.next
		slow = slow.next
	}
	if !isCunzai {
		return nil
	}

	fast = head
	for fast.next != slow {
		fast = fast.next
	}

}